import {request} from './request'

// 搜索默认关键词
export function getDefault(){
    return request({
        url: '/search/default',
        timestamp:Date.now()
    })
}

// 热搜榜简略
export function getSearchHot(){
    return request({
        url: '/search/hot'
    })
}

// 热搜榜详情
export function getHotDetail(){
    return request({
        url: '/search/hot/detail',
        withCredentials: true,
    })
}

// 搜索结果
export function searchResult(keywords, limit, offset, type){
    return request({
        url: '/search',
        withCredentials: true,
        params: {
            keywords,
            limit,
            offset, 
            type
        }
    })
}

// 搜索建议
export function searchSuggest(keywords){
    return request({
        url: '/search/suggest',
        withCredentials: true,
        params: {
            keywords,
            timestamp:Date.now()
        }
    })
}
